Skip to content

feat: add CONTRIBUTING.md and structural PR validation CI#62

Open
sendtoshailesh wants to merge 1 commit intomainfrom
feat/contributing-and-pr-validation
Open

feat: add CONTRIBUTING.md and structural PR validation CI#62
sendtoshailesh wants to merge 1 commit intomainfrom
feat/contributing-and-pr-validation

Conversation

@sendtoshailesh
Copy link
Copy Markdown
Contributor

Summary

Closes #17.

Adds a contributor guide and a structural PR validation pipeline so community skill contributions can be verified automatically.

This is a re-scoped replacement for #40, which mixed three concerns. The exploratory eval framework portion has been split into #61 and intentionally excluded from this PR.

Changes

  • CONTRIBUTING.md — skill contribution guide (directory structure, SKILL.md frontmatter schema, naming conventions), maintainer-curated agent change process, PR process, and a link to the Microsoft Open Source Code of Conduct.
  • .github/workflows/pr-validation.yml — active workflow on every PR to main:
    • structure-check job runs scripts/validate-structure.js.
    • markdownlint job runs across *.md (excluding website/node_modules, website/build, website/docs).
  • scripts/validate-structure.js — checks frontmatter required fields, name-directory consistency, kebab-case directory naming, SKILL.md presence, required sections (## When to Use, ## Procedure; ## Warning for agents), agent/skill cross-reference integrity, and relative-link resolution.
  • .markdownlint.json — shared lint config.

All checks pass against the current repo state.

What is not in this PR

The Agent/Skill eval framework (originally section 3 of #17) is tracked separately in #61 and is intentionally out of scope here. The earlier spike under evals/ from #40 is not carried over; #61 will revisit it from scratch.

Acceptance criteria mapping (#17, reduced scope)

  • CONTRIBUTING.md exists with clear skill contribution guidelines and SKILL.md schema.
  • Code of Conduct linked (Microsoft OSS standard).
  • PR validation workflow runs on every PR (active .yml, not .example.yml).
  • Frontmatter, naming, cross-reference, and section checks all pass on the current repo.

Notes for reviewers

Related

@sendtoshailesh sendtoshailesh requested a review from arnaudlh May 6, 2026 11:32
Implements scope of #17 (de-scoped):

- CONTRIBUTING.md: skill contribution guide, SKILL.md schema, PR process, Code of Conduct link

- .github/workflows/pr-validation.yml: structural validation + markdownlint on every PR

- scripts/validate-structure.js: frontmatter, naming, cross-reference, link, and section checks

- .markdownlint.json: shared lint config

The eval framework (originally section 3 of #17) is split out to #61 and is not part of this PR.

Supersedes #40.
@arnaudlh arnaudlh force-pushed the feat/contributing-and-pr-validation branch from 4e3b42e to 0dec1ad Compare May 7, 2026 00:35
@arnaudlh arnaudlh requested a review from Copilot May 7, 2026 00:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds contributor-facing documentation plus automated PR checks to validate the repo’s skill/agent Markdown structure and enforce Markdown linting, aligning with issue #17’s reduced scope.

Changes:

  • Added CONTRIBUTING.md describing skill contribution structure, frontmatter schema, and PR process/CI checks.
  • Added a PR workflow to run structural validation and markdownlint on pull requests to main.
  • Implemented scripts/validate-structure.js to validate skill/agent frontmatter, required sections, cross-references, and relative links.
Show a summary per file
File Description
scripts/validate-structure.js New Node.js validator for skills/agents structure, frontmatter, sections, cross-references, and relative links.
CONTRIBUTING.md New contributor guide describing how to add skills and what CI validates.
.markdownlint.json Shared markdownlint configuration for repo-wide Markdown linting.
.github/workflows/pr-validation.yml New PR workflow running structural validation + markdownlint on every PR to main.

Copilot's findings

Comments suppressed due to low confidence (1)

scripts/validate-structure.js:257

  • In checkCrossReferences(), slash-commands extracted from agent content are never validated or even warned on (the loop body is empty). This is dead code and also contradicts the intended “cross-reference integrity” check for agent docs. Either remove the unused extraction or implement the same warn/error behavior used for skills.
    // Check slash-command references in content
    const slashCommands = extractSlashCommands(content);
    for (const cmd of slashCommands) {
      if (!skillNames.has(cmd)) {
        // Only warn — some slash commands may reference non-skill entities
        // or be examples in documentation
      }
    }
  • Files reviewed: 4/4 changed files
  • Comments generated: 4

Comment on lines +74 to +82
// Match /skill-name patterns that look like intentional skill invocations
// Exclude common false positives: file paths, URLs, API paths
const PATH_PREFIXES = new Set([
'etc', 'dev', 'usr', 'var', 'tmp', 'home', 'opt', 'bin', 'sbin',
'api', 'v1', 'v2', 'v3', 'subscriptions', 'providers', 'admin',
]);
const matches = content.match(/(?:^|\s)\/([a-z][a-z0-9-]*)/gm) || [];
return matches
.map((m) => m.trim().slice(1))
Comment on lines +124 to +150
function checkSkillFrontmatter(skillDirs) {
console.log('\n🏷️ Skill frontmatter validation:');
for (const dir of skillDirs) {
const skillMd = path.join(SKILLS_DIR, dir, 'SKILL.md');
if (!fs.existsSync(skillMd)) continue;

const parsed = parseFrontmatter(skillMd);
if (!parsed) {
error(`${dir}/SKILL.md: Could not parse YAML frontmatter`);
continue;
}

const { data: fm } = parsed;

if (!fm.name) {
error(`${dir}/SKILL.md: Missing required frontmatter field 'name'`);
} else if (fm.name !== dir) {
error(`${dir}/SKILL.md: Frontmatter 'name' is '${fm.name}' but directory is '${dir}'`);
}

if (!fm.description) {
error(`${dir}/SKILL.md: Missing required frontmatter field 'description'`);
}
}
if (errors.length === 0) {
ok('All skills have valid frontmatter with name and description');
}
Comment thread CONTRIBUTING.md
Comment on lines +105 to +114
5. **CI checks run automatically** — The PR validation workflow verifies:
- YAML frontmatter has required fields (`name`, `description` for skills; `description` for agents)
- Skill `name` matches its parent directory name
- All skill/agent directories use kebab-case
- Every skill directory contains a `SKILL.md` file
- Skills have `## When to Use` and `## Procedure` sections
- Agents have a `## Warning` disclaimer section
- Cross-references (slash-commands `/skill-name`) map to existing skill directories
- Relative markdown links resolve to real file paths
- Markdown passes linting (markdownlint)
node-version: '20'

- name: Install markdownlint-cli
run: npm install -g markdownlint-cli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CONTRIBUTING.md and contribution verification CI

2 participants